/***************************************************************************
 *   Salatinoid - Islamic Prayer Time Plasmoid                             *
 *   Copyright (C) 2009 by Tarek Saidi  <tarek.saidi@arcor.de>             *
 *                                                                         *
 *   Bismillah ar-Rahman ar-Rahim;                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation, either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program. If not, see <http://www.gnu.org/licenses/>.  *
 ***************************************************************************/


#ifndef GRAPHICSTEXTWIDGET_H
#define GRAPHICSTEXTWIDGET_H

#include <QGraphicsWidget>

class GraphicsTextWidget : public QGraphicsWidget{
    public:
        GraphicsTextWidget(const QString& text);
        void setText(const QString& text);
        void setTextAlign(Qt::Alignment);
        virtual void setFont(const QFont& font);
        virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0);
        virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
        virtual void updateGeometry();
    private:
        QString       m_Text;
        Qt::Alignment m_TextAlign;
        QSize         textSize;
};

#endif // GRAPHICSTEXTWIDGET_H
